package com.wy.ssm.controller;

import com.wy.ssm.domain.City;
import com.wy.ssm.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author: wy
 * @Date:2019/9/4 21:00
 */

@Controller
@RequestMapping("/city")
public class CityController {
       @Autowired
    private CityService cityService;



       @RequestMapping("/findAll")
       @ResponseBody
       public List<City> findAll()throws Exception{
           List<City> citys = cityService.findAll();
           System.out.println(citys);
            return  citys;
       }

}
